package top.maven;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * Created by Administrator on 2017/10/16.
 */
public class UserInvocationHander implements InvocationHandler{

    private Object name;

    UserInvocationHander(){}

    UserInvocationHander(Object name){
        this.name=name;
    }


    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println(method.getName());
        Object object = method.invoke(name, args);
        System.out.println(method.getName());
        return object;
    }
}
